home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Devpac 2.12 disk 2.adf / include.cbm / intuition / intuition.i next >
Text File  |  1987-03-31  |  54KB  |  1,341 lines

  1.         IFND    INTUITION_INTUITION_I
  2. INTUITION_INTUITION_I   SET     1
  3.  
  4. ;** intuition.i *************************************************************
  5. ;*
  6. ;*  intuition.i main include file for assembly-language programmers
  7. ;*
  8. **  $Header: intuition.i,v 33.1 86/09/30 19:55:43 neil Exp $
  9. ;*
  10. ;*  Confidential Information: Commodore-Amiga Computer, Inc.
  11. ;*  Copyright (c) Commodore-Amiga Computer, Inc.
  12. ;*                              Modification History
  13. ;*      date    :   author :    Comments
  14. ;*     ------       ------      -------------------------------------
  15. ;*     1-30-85      -=RJ=-      created this file!
  16. ;*     6-12-85      Dale and Carl translated this from the c version
  17. ;*     6-13-85      =VoodooDrRj= added back the comments
  18. ;*     4-07-86      Barry.      Bring this file up to date with the .h file
  19. ;*
  20. ;****************************************************************************
  21. ;* CONFIDENTIAL and PROPRIETARY
  22. ;* Copyright (C) 1985, COMMODORE-AMIGA, INC.
  23. ;* All Rights Reserved
  24. ;****************************************************************************/
  25.  
  26.         IFND EXEC_TYPES_I
  27.         INCLUDE "exec/types.i"
  28.         ENDC
  29.  
  30.         IFND    GRAPHICS_GFX_I
  31.         include 'graphics/gfx.i'
  32.         ENDC
  33.  
  34.         IFND    GRAPHICS_CLIP_I
  35.         include 'graphics/clip.i'
  36.         ENDC
  37.  
  38.         IFND    GRAPHICS_VIEW_I
  39.         include 'graphics/view.i'
  40.         ENDC
  41.  
  42.         IFND    GRAPHICS_RASTPORT_I
  43.         include 'graphics/rastport.i'
  44.         ENDC
  45.  
  46.         IFND    GRAPHICS_LAYERS_I
  47.         include 'graphics/layers.i'
  48.         ENDC
  49.  
  50.         IFND    GRAPHICS_TEXT_I
  51.         include 'graphics/text.i'
  52.         ENDC
  53.  
  54.         IFND EXEC_PORTS_I
  55.         include 'exec/ports.i'
  56.         ENDC
  57.  
  58.         IFND    DEVICES_TIMER_I
  59.         include 'devices/timer.i'
  60.         ENDC
  61.  
  62.         IFND    DEVICES_INPUTEVENT_I
  63.         include 'devices/inputevent.i'
  64.         ENDC
  65.  
  66.  
  67. ; ========================================================================;
  68. ; === Menu ===============================================================;
  69. ; ========================================================================;
  70.  STRUCTURE Menu,0
  71.  
  72.     APTR  mu_NextMenu   ; menu pointer, same level
  73.     WORD mu_LeftEdge    ; position of the select box
  74.     WORD mu_TopEdge     ; position of the select box
  75.     WORD mu_Width       ; dimensions of the select box
  76.     WORD mu_Height      ; dimensions of the select box
  77.     WORD mu_Flags       ; see flag definitions below
  78.     APTR mu_MenuName    ; text for this Menu Header
  79.     APTR  mu_FirstItem  ; pointer to first in chain
  80.  
  81.     ; these mysteriously-named variables are for internal use only
  82.     WORD mu_JazzX
  83.     WORD mu_JazzY
  84.     WORD mu_BeatX
  85.     WORD mu_BeatY
  86.  
  87.     LABEL mu_SIZEOF
  88.  
  89. ;*** FLAGS SET BY BOTH THE APPLIPROG AND INTUITION ***
  90. MENUENABLED EQU $0001   ; whether or not this menu is enabled
  91.  
  92. ;*** FLAGS SET BY INTUITION ***
  93. MIDRAWN EQU $0100       ; this menu's items are currently drawn
  94.  
  95. ; ========================================================================;
  96. ; === MenuItem ===========================================================;
  97. ; ========================================================================;
  98.  STRUCTURE MenuItem,0
  99.  
  100.     APTR mi_NextItem    ; pointer to next in chained list
  101.     WORD mi_LeftEdge    ; position of the select box
  102.     WORD mi_TopEdge     ; position of the select box
  103.     WORD mi_Width       ; dimensions of the select box
  104.     WORD mi_Height      ; dimensions of the select box
  105.     WORD mi_Flags       ; see the defines below
  106.  
  107.     LONG mi_MutualExclude ; set bits mean this item excludes that item
  108.  
  109.     APTR mi_ItemFill    ; points to Image, IntuiText, or NULL
  110.  
  111.     ; when this item is pointed to by the cursor and the items highlight
  112.     ; mode HIGHIMAGE is selected, this alternate image will be displayed
  113.     APTR mi_SelectFill  ; points to Image, IntuiText, or NULL
  114.  
  115.     BYTE mi_Command     ; only if appliprog sets the COMMSEQ flag
  116.  
  117.     BYTE mi_KludgeFill00 ; This is strictly for word-alignment
  118.  
  119.     APTR mi_SubItem     ; if non-zero, DrawMenu shows "->"
  120.  
  121.    ; The NextSelect field represents the menu number of next selected 
  122.    ; item (when user has drag-selected several items)
  123.     WORD mi_NextSelect
  124.  
  125.     LABEL  mi_SIZEOF
  126.  
  127. ; --- FLAGS SET BY THE APPLIPROG --------------------------------------------
  128. CHECKIT         EQU $0001       ; whether to check this item if selected
  129. ITEMTEXT        EQU $0002       ; set if textual, clear if graphical item
  130. COMMSEQ         EQU $0004       ; set if there's an command sequence
  131. MENUTOGGLE      EQU $0008       ; set to toggle the check of a menu item 
  132. ITEMENABLED     EQU $0010       ; set if this item is enabled
  133.  
  134. ; these are the SPECIAL HIGHLIGHT FLAG state meanings 
  135. HIGHFLAGS       EQU $00C0       ; see definitions below for these bits
  136. HIGHIMAGE       EQU $0000       ; use the user's "select image"
  137. HIGHCOMP        EQU $0040       ; highlight by complementing the select box
  138. HIGHBOX         EQU $0080       ; highlight by drawing a box around the image
  139. HIGHNONE        EQU $00C0       ; don't highlight
  140.  
  141. ; --- FLAGS SET BY BOTH APPLIPROG AND INTUITION -----------------------------
  142. CHECKED         EQU $0100       ; if CHECKIT, then set this when selected
  143.  
  144.  
  145. ; --- FLAGS SET BY INTUITION ------------------------------------------------
  146. ISDRAWN         EQU $1000       ; this item's subs are currently drawn
  147. HIGHITEM        EQU $2000       ; this item is currently highlighted
  148. MENUTOGGLED     EQU $4000       ; this item was already toggled 
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155. ; ========================================================================
  156. ; === Requester ==========================================================
  157. ; ========================================================================
  158.  STRUCTURE Requester,0
  159.  
  160.     ; the ClipRect and BitMap and used for rendering the requester
  161.     APTR  rq_OlderRequest
  162.     WORD rq_LeftEdge            ; dimensions of the entire box
  163.     WORD rq_TopEdge             ; dimensions of the entire box
  164.     WORD rq_Width               ; dimensions of the entire box
  165.     WORD rq_Height              ; dimensions of the entire box
  166.  
  167.     WORD rq_RelLeft             ; get POINTREL Pointer relativity offsets
  168.     WORD rq_RelTop              ; get POINTREL Pointer relativity offsets
  169.  
  170.     APTR  rq_ReqGadget          ; pointer to the first of a list of gadgets
  171.     APTR  rq_ReqBorder          ; the box's border
  172.     APTR  rq_ReqText            ; the box's text
  173.  
  174.     WORD  rq_Flags              ; see definitions below
  175.  
  176.     UBYTE rq_BackFill           ; pen number for back-plane fill before draws
  177.  
  178.     BYTE rq_KludgeFill00        ; This is strictly for word-alignment
  179.  
  180.     APTR rq_ReqLayer            ; layer in which requester rendered
  181.     STRUCT rq_ReqPad1,32        ; for backwards compatibility (reserved)
  182.  
  183.     ; If the BitMap plane pointers are non-zero, this tells the system 
  184.     ; that the image comes pre-drawn (if the appliprog wants to define 
  185.     ; it's own box, in any shape or size it wants!); this is OK by 
  186.     ; Intuition as long as there's a good correspondence between the image 
  187.     ; and the specified Gadgets
  188.     APTR  rq_ImageBMap          ; points to the BitMap of PREDRAWN imagery
  189.  
  190.     APTR  rq_RWindow            ; points back to requester's window
  191.     STRUCT rq_ReqPad2,36        ; for backwards compatibility (reserved)
  192.  
  193.     LABEL rq_SIZEOF
  194.  
  195. ; FLAGS SET BY THE APPLIPROG
  196. POINTREL        EQU $0001  ; if POINTREL set, TopLeft is relative to pointer
  197. PREDRAWN        EQU $0002  ; if ReqBMap points to predrawn Requester imagery
  198. NOISYREQ        EQU $0004  ; if you don't want requester to filter input
  199.  
  200. ; FLAGS SET BY INTUITION;
  201. REQOFFWINDOW    EQU $1000       ; part of one of the Gadgets was offwindow
  202. REQACTIVE       EQU $2000       ; this requester is active
  203. SYSREQUEST      EQU $4000       ; this requester caused by system
  204. DEFERREFRESH    EQU $8000       ; this Requester stops a Refresh broadcast
  205.  
  206.  
  207.  
  208.  
  209.  
  210. ; ========================================================================
  211. ; === Gadget =============================================================
  212. ; ========================================================================
  213.  STRUCTURE Gadget,0
  214.  
  215.     APTR gg_NextGadget          ; next gadget in the list
  216.  
  217.     WORD gg_LeftEdge            ; "hit box" of gadget
  218.     WORD gg_TopEdge             ; "hit box" of gadget
  219.     WORD gg_Width               ; "hit box" of gadget
  220.     WORD gg_Height              ; "hit box" of gadget
  221.  
  222.     WORD gg_Flags               ; see below for list of defines
  223.  
  224.     WORD gg_Activation          ; see below for list of defines
  225.  
  226.     WORD gg_GadgetType          ; see below for defines
  227.  
  228.     ; appliprog can specify that the Gadget be rendered as either as Border
  229.     ; or an Image.  This variable points to which (or equals NULL if there's
  230.     ; nothing to be rendered about this Gadget)
  231.     APTR gg_GadgetRender
  232.  
  233.     ; appliprog can specify "highlighted" imagery rather than algorithmic
  234.     ; this can point to either Border or Image data
  235.     APTR gg_SelectRender
  236.  
  237.     APTR gg_GadgetText          ; text for this gadget;
  238.  
  239.     ; by using the MutualExclude word, the appliprog can describe 
  240.     ; which gadgets mutually-exclude which other ones.  The bits in 
  241.     ; MutualExclude correspond to the gadgets in object containing 
  242.     ; the gadget list.  If this gadget is selected and a bit is set 
  243.     ; in this gadget's MutualExclude and the gadget corresponding to 
  244.     ; that bit is currently selected (e.g. bit 2 set and gadget 2 
  245.     ; is currently selected) that gadget must be unselected.  Intuition 
  246.     ; does the visual unselecting (with checkmarks) and leaves it up 
  247.     ; to the program to unselect internally
  248.     LONG gg_MutualExclude       ; set bits mean this gadget excludes that
  249.  
  250.     ; pointer to a structure of special data required by Proportional, String 
  251.     ; and Integer Gadgets
  252.     APTR gg_SpecialInfo
  253.  
  254.     WORD gg_GadgetID    ; user-definable ID field
  255.     APTR  gg_UserData   ; ptr to general purpose User data (ignored by Intuit)
  256.  
  257.     LABEL gg_SIZEOF
  258.  
  259. ; --- FLAGS SET BY THE APPLIPROG --------------------------------------------
  260. ; combinations in these bits describe the highlight technique to be used
  261. GADGHIGHBITS    EQU $0003
  262. GADGHCOMP       EQU $0000       ; Complement the select box
  263. GADGHBOX        EQU $0001       ; Draw a box around the image
  264. GADGHIMAGE      EQU $0002       ; Blast in this alternate image
  265. GADGHNONE       EQU $0003       ; don't highlight
  266.  
  267. ; set this flag if the GadgetRender and SelectRender point to Image imagery, 
  268. ; clear if it's a Border 
  269. GADGIMAGE       EQU $0004 
  270.  
  271. ; combinations in these next two bits specify to which corner the gadget's
  272. ; Left & Top coordinates are relative.  If relative to Top/Left,
  273. ; these are "normal" coordinates (everything is relative to something in
  274. ; this universe)
  275. GRELBOTTOM      EQU $0008       ; set if rel to bottom, clear if rel top
  276. GRELRIGHT       EQU $0010       ; set if rel to right, clear if to left
  277. ; set the RELWIDTH bit to spec that Width is relative to width of screen
  278. GRELWIDTH       EQU $0020
  279. ; set the RELHEIGHT bit to spec that Height is rel to height of screen
  280. GRELHEIGHT      EQU $0040
  281.  
  282. ; the SELECTED flag is initialized by you and set by Intuition.  It 
  283. ; specifies whether or not this Gadget is currently selected/highlighted
  284. SELECTED        EQU $0080
  285.  
  286.  
  287. ; the GADGDISABLED flag is initialized by you and later set by Intuition
  288. ; according to your calls to On/OffGadget().  It specifies whether or not 
  289. ; this Gadget is currently disabled from being selected
  290. GADGDISABLED    EQU $0100
  291.  
  292.  
  293. ; --- These are the Activation flag bits ----------------------------------
  294. ; RELVERIFY is set if you want to verify that the pointer was still over
  295. ; the gadget when the select button was released
  296. RELVERIFY       EQU $0001
  297.  
  298. ; the flag GADGIMMEDIATE, when set, informs the caller that the gadget
  299. ; was activated when it was activated.  this flag works in conjunction with
  300. ; the RELVERIFY flag
  301. GADGIMMEDIATE   EQU $0002
  302.  
  303. ; the flag ENDGADGET, when set, tells the system that this gadget, when
  304. ; selected, causes the Requester or AbsMessage to be ended.  Requesters or
  305. ; AbsMessages that are ended are erased and unlinked from the system
  306. ENDGADGET       EQU $0004
  307.  
  308. ; the FOLLOWMOUSE flag, when set, specifies that you want to receive
  309. ; reports on mouse movements (ie, you want the REPORTMOUSE function for
  310. ; your Window).  When the Gadget is deselected (immediately if you have
  311. ; no RELVERIFY) the previous state of the REPORTMOUSE flag is restored
  312. ; You probably want to set the GADGIMMEDIATE flag when using FOLLOWMOUSE,
  313. ; since that's the only reasonable way you have of learning why Intuition
  314. ; is suddenly sending you a stream of mouse movement events.  If you don't
  315. ; set RELVERIFY, you'll get at least one Mouse Position event.
  316. FOLLOWMOUSE     EQU $0008
  317.  
  318. ; if any of the BORDER flags are set in a Gadget that's included in the
  319. ; Gadget list when a Window is opened, the corresponding Border will
  320. ; be adjusted to make room for the Gadget
  321. RIGHTBORDER     EQU $0010
  322. LEFTBORDER      EQU $0020
  323. TOPBORDER       EQU $0040
  324. BOTTOMBORDER    EQU $0080
  325.  
  326. TOGGLESELECT    EQU $0100       ; this bit for toggle-select mode
  327.  
  328. STRINGCENTER    EQU $0200       ; center the String
  329. STRINGRIGHT     EQU $0400       ; right-justify the String
  330.  
  331. LONGINT         EQU $0800       ; This String Gadget is a Long Integer
  332.  
  333. ALTKEYMAP       EQU $1000       ; This String has an alternate keymapping
  334.  
  335. BOOLEXTEND      EQU $2000       ; This Boolean Gadget has a BoolInfo
  336.  
  337. ; --- GADGET TYPES -----------------------------------------------------------
  338. ; These are the Gaget Type definitions for the variable GadgetType.
  339. ; Gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  340. ; first comes the mask for Gadget flags reserved for Gadget typing
  341. GADGETTYPE      EQU $FC00       ; all Gadget Global Type flags (padded)
  342. SYSGADGET       EQU $8000       ; 1 = SysGadget, 0 = AppliGadget
  343. SCRGADGET       EQU $4000       ; 1 = ScreenGadget, 0 = WindowGadget
  344. GZZGADGET       EQU $2000       ; 1 = Gadget for GIMMEZEROZERO borders
  345. REQGADGET       EQU $1000       ; 1 = this is a Requester Gadget
  346. ; system gadgets
  347. SIZING          EQU $0010
  348. WDRAGGING       EQU $0020
  349. SDRAGGING       EQU $0030
  350. WUPFRONT        EQU $0040
  351. SUPFRONT        EQU $0050
  352. WDOWNBACK       EQU $0060
  353. SDOWNBACK       EQU $0070
  354. CLOSE           EQU $0080
  355. ; application gadgets
  356. BOOLGADGET      EQU $0001
  357. GADGET0002      EQU $0002
  358. PROPGADGET      EQU $0003
  359. STRGADGET       EQU $0004
  360.  
  361.  
  362.  
  363. ; ======================================================================== 
  364. ; === BoolInfo============================================================
  365. ; ======================================================================== 
  366. ; This is the special data needed by an Extended Boolean Gadget
  367. ; Typically this structure will be pointed to by the Gadget field SpecialInfo
  368.  
  369.  STRUCTURE BoolInfo,0
  370.  
  371.     WORD    bi_Flags    ; defined below 
  372.     APTR    bi_Mask     ; bit mask for highlighting and selecting
  373.                         ; mask must follow the same rules as an Image
  374.                         ; plane.  It's width and height are determined
  375.                         ; by the width and height of the gadget's 
  376.                         ; select box. (i.e. Gadget.Width and .Height).
  377.     LONG    bi_Reserved ; set to 0
  378.  
  379.     LABEL   bi_SIZEOF
  380.  
  381. ; set BoolInfo.Flags to this flag bit.
  382. ; in the future, additional bits might mean more stuff hanging
  383. ; off of BoolInfo.Reserved.
  384.  
  385. BOOLMASK        EQU     $0001   ; extension is for masked gadget
  386.  
  387. ; ========================================================================
  388. ; === PropInfo ===========================================================
  389. ; ========================================================================
  390. ; this is the special data required by the proportional Gadget
  391. ; typically, this data will be pointed to by the Gadget variable SpecialInfo
  392.  STRUCTURE PropInfo,0
  393.  
  394.     WORD pi_Flags       ; general purpose flag bits (see defines below)
  395.  
  396.     ; You initialize the Pot variables before the Gadget is added to 
  397.     ; the system.  Then you can look here for the current settings 
  398.     ; any time, even while User is playing with this Gadget.  To 
  399.     ; adjust these after the Gadget is added to the System, use 
  400.     ; ModifyProp(); The Pots are the actual proportional settings, 
  401.     ; where a value of zero means zero and a value of MAXPOT means 
  402.     ; that the Gadget is set to its maximum setting.
  403.     WORD pi_HorizPot    ; 16-bit FixedPoint horizontal quantity percentage;
  404.     WORD pi_VertPot     ; 16-bit FixedPoint vertical quantity percentage;
  405.  
  406.     ; the 16-bit FixedPoint Body variables describe what percentage 
  407.     ; of the entire body of stuff referred to by this Gadget is 
  408.     ; actually shown at one time.  This is used with the AUTOKNOB 
  409.     ; routines, to adjust the size of the AUTOKNOB according to how 
  410.     ; much of the data can be seen.  This is also used to decide how 
  411.     ; far to advance the Pots when User hits the Container of the Gadget.  
  412.     ; For instance, if you were controlling the display of a 5-line 
  413.     ; Window of text with this Gadget, and there was a total of 15 
  414.     ; lines that could be displayed, you would set the VertBody value to 
  415.     ;    (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  416.     ; Therefore, the AUTOKNOB would fill 1/3 of the container, and if 
  417.     ; User hits the Cotainer outside of the knob, the pot would advance 
  418.     ; 1/3 (plus or minus) If there's no body to show, or the total 
  419.     ; amount of displayable info is less than the display area, set the 
  420.     ; Body variables to the MAX.  To adjust these after the Gadget is 
  421.     ; added to the System, use ModifyProp().
  422.     WORD pi_HorizBody   ; horizontal Body
  423.     WORD pi_VertBody    ; vertical Body
  424.  
  425.     ; these are the variables that Intuition sets and maintains
  426.     WORD pi_CWidth      ; Container width (with any relativity absoluted)
  427.     WORD pi_CHeight     ; Container height (with any relativity absoluted)
  428.     WORD pi_HPotRes     ; pot increments
  429.     WORD pi_VPotRes     ; pot increments
  430.     WORD pi_LeftBorder  ; Container borders
  431.     WORD pi_TopBorder   ; Container borders
  432.     LABEL  pi_SIZEOF
  433.  
  434. ; --- FLAG BITS --------------------------------------------------------------
  435. AUTOKNOB        EQU $0001       ; this flag sez:  gimme that old auto-knob
  436. FREEHORIZ       EQU $0002       ; if set, the knob can move horizontally
  437. FREEVERT        EQU $0004       ; if set, the knob can move vertically
  438. PROPBORDERLESS  EQU $0008       ; if set, no border will be rendered
  439. KNOBHIT         EQU $0100       ; set when this Knob is hit
  440.  
  441.  
  442. KNOBHMIN        EQU 6           ; minimum horizontal size of the knob
  443. KNOBVMIN        EQU 4           ; minimum vertical size of the knob
  444. MAXBODY         EQU $FFFF       ; maximum body value
  445. MAXPOT          EQU $FFFF       ; maximum pot value
  446.  
  447.  
  448. ; ========================================================================
  449. ; === StringInfo =========================================================
  450. ; ========================================================================
  451. ; this is the special data required by the string Gadget
  452. ; typically, this data will be pointed to by the Gadget variable SpecialInfo
  453.  STRUCTURE StringInfo,0
  454.  
  455.     ; you initialize these variables, and then Intuition maintains them
  456.     APTR  si_Buffer     ; the buffer containing the start and final string
  457.     APTR  si_UndoBuffer ; optional buffer for undoing current entry
  458.     WORD si_BufferPos   ; character position in Buffer
  459.     WORD si_MaxChars    ; max number of chars in Buffer (including NULL)
  460.     WORD si_DispPos     ; Buffer position of first displayed character
  461.  
  462.     ; Intuition initializes and maintains these variables for you
  463.     WORD si_UndoPos     ; character position in the undo buffer
  464.     WORD si_NumChars    ; number of characters currently in Buffer
  465.     WORD si_DispCount   ; number of whole characters visible in Container
  466.     WORD si_CLeft       ; topleft offset of the container
  467.     WORD si_CTop        ; topleft offset of the container
  468.     APTR  si_LayerPtr   ; the RastPort containing this Gadget
  469.  
  470.     ; you can initialize this variable before the gadget is submitted to
  471.     ; Intuition, and then examine it later to discover what integer 
  472.     ; the user has entered (if the user never plays with the gadget, 
  473.     ; the value will be unchanged from your initial setting)
  474.     LONG  si_LongInt    ; the LONG return value of a LONGINT String Gadget
  475.  
  476.     ; If you want this Gadget to use your own Console keymapping, you
  477.     ; set the ALTKEYMAP bit in the Activation flags of the Gadget, and then
  478.     ; set this variable to point to your keymap.  If you don't set the
  479.     ; ALTKEYMAP, you'll get the standard ASCII keymapping.
  480.     APTR si_AltKeyMap
  481.  
  482.     LABEL si_SIZEOF
  483.  
  484.  
  485.  
  486.  
  487. ; ========================================================================
  488. ; === IntuiText ==========================================================
  489. ; ========================================================================
  490. ; IntuiText is a series of strings that start with a screen location
  491. ; (always relative to the upper-left corner of something) and then the
  492. ; text of the string.  The text is null-terminated.
  493.  STRUCTURE IntuiText,0
  494.  
  495.     BYTE it_FrontPen            ; the pens for rendering the text
  496.     BYTE it_BackPen             ; the pens for rendering the text
  497.  
  498.     BYTE it_DrawMode            ; the mode for rendering the text
  499.  
  500.     BYTE it_KludgeFill00        ; This is strictly for word-alignment 
  501.  
  502.     WORD it_LeftEdge            ; relative start location for the text
  503.     WORD it_TopEdge             ; relative start location for the text
  504.  
  505.     APTR  it_ITextFont          ; if NULL, you accept the defaults
  506.  
  507.     APTR it_IText               ; pointer to null-terminated text
  508.  
  509.     APTR  it_NextText           ; continuation to TxWrite another text
  510.  
  511.     LABEL it_SIZEOF
  512.  
  513.  
  514.  
  515.  
  516.  
  517. ; ========================================================================
  518. ; === Border =============================================================
  519. ; ========================================================================
  520. ; Data type Border, used for drawing a series of lines which is intended for
  521. ; use as a border drawing, but which may, in fact, be used to render any
  522. ; arbitrary vector shape.
  523. ; The routine DrawBorder sets up the RastPort with the appropriate
  524. ; variables, then does a Move to the first coordinate, then does Draws
  525. ; to the subsequent coordinates.
  526. ; After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  527. ; recursively
  528.  STRUCTURE Border,0
  529.  
  530.     WORD  bd_LeftEdge           ; initial offsets from the origin
  531.     WORD  bd_TopEdge            ; initial offsets from the origin
  532.     BYTE  bd_FrontPen           ; pen number for rendering 
  533.     BYTE  bd_BackPen            ; pen number for rendering 
  534.     BYTE  bd_DrawMode           ; mode for rendering 
  535.     BYTE  bd_Count              ; number of XY pairs
  536.     APTR  bd_XY                 ; vector coordinate pairs rel to LeftTop
  537.     APTR  bd_NextBorder         ; pointer to any other Border too
  538.  
  539.     LABEL bd_SIZEOF
  540.  
  541.  
  542. ; ======================================================================== 
  543. ; === Image ============================================================== 
  544. ; ======================================================================== 
  545. ; This is a brief image structure for very simple transfers of 
  546. ; image data to a RastPort
  547.  STRUCTURE Image,0
  548.  
  549.     WORD ig_LeftEdge            ; starting offset relative to something 
  550.     WORD ig_TopEdge             ; starting offset relative to something 
  551.     WORD ig_Width               ; pixel size (though data is word-aligned)
  552.     WORD ig_Height              ; pixel size 
  553.     WORD ig_Depth               ; pixel size 
  554.     APTR ig_ImageData           ; pointer to the actual image bits
  555.  
  556.     ; the PlanePick and PlaneOnOff variables work much the same way as the
  557.     ; equivalent GELS Bob variables.  It's a space-saving 
  558.     ; mechanism for image data.  Rather than defining the image data
  559.     ; for every plane of the RastPort, you need define data only for planes 
  560.     ; that are not entirely zero or one.  As you define your Imagery, you will
  561.     ; often find that most of the planes ARE just as color selectors.  For
  562.     ; instance, if you're designing a two-color Gadget to use colors two and
  563.     ; three, and the Gadget will reside in a five-plane display, plane zero
  564.     ; of your imagery would be all ones, bit plane one would have data that
  565.     ; describes the imagery, and bit planes two through four would be
  566.     ; all zeroes.  Using these flags allows you to avoid wasting all that 
  567.     ; memory in this way:  
  568.     ; first, you specify which planes you want your data to appear 
  569.     ; in using the PlanePick variable.  For each bit set in the variable, the 
  570.     ; next "plane" of your image data is blitted to the display.  For each bit
  571.     ; clear in this variable, the corresponding bit in PlaneOnOff is examined.
  572.     ; If that bit is clear, a "plane" of zeroes will be used.  If the bit is 
  573.     ; set, ones will go out instead.  So, for our example:
  574.     ;   Gadget.PlanePick = 0x02;
  575.     ;   Gadget.PlaneOnOff = 0x01;
  576.     ; Note that this also allows for generic Gadgets, like the System Gadgets,
  577.     ; which will work in any number of bit planes
  578.     ; Note also that if you want an Image that is only a filled rectangle,
  579.     ; you can get this by setting PlanePick to zero (pick no planes of data)
  580.     ; and set PlaneOnOff to describe the pen color of the rectangle.
  581.     BYTE ig_PlanePick
  582.     BYTE ig_PlaneOnOff
  583.  
  584.     ; if the NextImage variable is not NULL, Intuition presumes that 
  585.     ; it points to another Image structure with another Image to be 
  586.     ; rendered
  587.     APTR ig_NextImage
  588.  
  589.  
  590.     LABEL ig_SIZEOF
  591.  
  592.  
  593.  
  594.  
  595. ; ======================================================================== 
  596. ; === IntuiMessage ======================================================= 
  597. ; ======================================================================== 
  598.  STRUCTURE IntuiMessage,0
  599.  
  600.     STRUCT im_ExecMessage,MN_SIZE
  601.  
  602.     ; the Class bits correspond directly with the IDCMP Flags, except for the
  603.     ; special bit LONELYMESSAGE (defined below)
  604.     LONG im_Class
  605.  
  606.     ; the Code field is for special values like MENU number 
  607.     WORD im_Code
  608.  
  609.     ; the Qualifier field is a copy of the current InputEvent's Qualifier 
  610.     WORD im_Qualifier
  611.  
  612.     ; IAddress contains particular addresses for Intuition functions, like
  613.     ; the pointer to the Gadget or the Screen
  614.     APTR im_IAddress
  615.  
  616.     ; when getting mouse movement reports, any event you get will have the
  617.     ; the mouse coordinates in these variables.  the coordinates are relative
  618.     ; to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding)
  619.     WORD im_MouseX
  620.     WORD im_MouseY
  621.  
  622.     ; the time values are copies of the current system clock time.  Micros
  623.     ; are in units of microseconds, Seconds in seconds.
  624.     LONG im_Seconds
  625.     LONG im_Micros
  626.  
  627.     ; the IDCMPWindow variable will always have the address of the Window of 
  628.     ; this IDCMP 
  629.     APTR im_IDCMPWindow
  630.  
  631.     ; system-use variable 
  632.     APTR im_SpecialLink
  633.  
  634.     LABEL  im_SIZEOF
  635.  
  636.  
  637.  
  638. ; --- IDCMP Classes ------------------------------------------------------ 
  639. SIZEVERIFY      EQU     $00000001       ; See the Programmer's Guide
  640. NEWSIZE         EQU     $00000002       ; See the Programmer's Guide
  641. REFRESHWINDOW   EQU     $00000004       ; See the Programmer's Guide
  642. MOUSEBUTTONS    EQU     $00000008       ; See the Programmer's Guide
  643. MOUSEMOVE       EQU     $00000010       ; See the Programmer's Guide 
  644. GADGETDOWN      EQU     $00000020       ; See the Programmer's Guide
  645. GADGETUP        EQU     $00000040       ; See the Programmer's Guide 
  646. REQSET          EQU     $00000080       ; See the Programmer's Guide
  647. MENUPICK        EQU     $00000100       ; See the Programmer's Guide 
  648. CLOSEWINDOW     EQU     $00000200       ; See the Programmer's Guide
  649. RAWKEY          EQU     $00000400       ; See the Programmer's Guide 
  650. REQVERIFY       EQU     $00000800       ; See the Programmer's Guide
  651. REQCLEAR        EQU     $00001000       ; See the Programmer's Guide 
  652. MENUVERIFY      EQU     $00002000       ; See the Programmer's Guide
  653. NEWPREFS        EQU     $00004000       ; See the Programmer's Guide 
  654. DISKINSERTED    EQU     $00008000       ; See the Programmer's Guide
  655. DISKREMOVED     EQU     $00010000       ; See the Programmer's Guide 
  656. WBENCHMESSAGE   EQU     $00020000       ; See the Programmer's Guide
  657. ACTIVEWINDOW    EQU     $00040000       ; See the Programmer's Guide
  658. INACTIVEWINDOW  EQU     $00080000       ; See the Programmer's Guide
  659. DELTAMOVE       EQU     $00100000       ; See the Programmer's Guide
  660. VANILLAKEY      EQU     $00200000       ; See the Programmer's Guide
  661. INTUITICKS      EQU     $00400000       ; See the Programmer's Guide
  662. ; NOTEZ-BIEN:           $80000000 is reserved for internal use by IDCMP
  663.  
  664. ; the IDCMP Flags do not use this special bit, which is cleared when
  665. ; Intuition sends its special message to the Task, and set when Intuition
  666. ; gets its Message back from the Task.  Therefore, I can check here to
  667. ; find out fast whether or not this Message is available for me to send
  668. LONELYMESSAGE   EQU     $80000000
  669.  
  670.  
  671.  
  672. ; --- IDCMP Codes -------------------------------------------------------- 
  673. ; This group of codes is for the MENUVERIFY function 
  674. MENUHOT         EQU     $0001   ; IntuiWants verification or MENUCANCEL    
  675. MENUCANCEL      EQU     $0002   ; HOT Reply of this cancels Menu operation 
  676. MENUWAITING     EQU     $0003   ; Intuition simply wants a ReplyMsg() ASAP 
  677.  
  678. ; These are internal tokens to represent state of verification attempts
  679. ; shown here as a clue.
  680. OKOK            EQU     MENUHOT         ; guy didn't care
  681. OKABORT         EQU     $0004           ; window rendered question moot
  682. OKCANCEL        EQU     MENUCANCEL      ; window sent cancel reply
  683.  
  684. ; This group of codes is for the WBENCHMESSAGE messages
  685. WBENCHOPEN      EQU $0001
  686. WBENCHCLOSE     EQU $0002
  687.  
  688.  
  689.  
  690.  
  691. ; ======================================================================== 
  692. ; === Window ============================================================= 
  693. ; ======================================================================== 
  694.  STRUCTURE Window,0
  695.  
  696.     APTR wd_NextWindow          ; for the linked list of a Screen
  697.  
  698.     WORD wd_LeftEdge            ; screen dimensions
  699.     WORD wd_TopEdge             ; screen dimensions
  700.     WORD wd_Width               ; screen dimensions
  701.     WORD wd_Height              ; screen dimensions
  702.  
  703.     WORD wd_MouseY              ; relative top top-left corner 
  704.     WORD wd_MouseX              ; relative top top-left corner 
  705.  
  706.     WORD wd_MinWidth            ; minimum sizes
  707.     WORD wd_MinHeight           ; minimum sizes
  708.     WORD wd_MaxWidth            ; maximum sizes
  709.     WORD wd_MaxHeight           ; maximum sizes
  710.  
  711.     LONG wd_Flags               ; see below for definitions
  712.  
  713.     APTR wd_MenuStrip           ; first in a list of menu headers
  714.  
  715.     APTR wd_Title               ; title text for the Window
  716.  
  717.     APTR wd_FirstRequest        ; first in linked list of active Requesters 
  718.     APTR wd_DMRequest           ; the double-menu Requester 
  719.     WORD wd_ReqCount            ; number of Requesters blocking this Window
  720.     APTR wd_WScreen             ; this Window's Screen
  721.     APTR wd_RPort               ; this Window's very own RastPort
  722.  
  723.     ; the border variables describe the window border.  If you specify
  724.     ; GIMMEZEROZERO when you open the window, then the upper-left of the
  725.     ; ClipRect for this window will be upper-left of the BitMap (with correct
  726.     ; offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when
  727.     ; using SuperBitMap).  If you don't specify ZeroZero, then you save
  728.     ; memory (no allocation of RastPort, Layer, ClipRect and associated
  729.     ; Bitmaps), but you also must offset all your writes by BorderTop,
  730.     ; BorderLeft and do your own mini-clipping to prevent writing over the
  731.     ; system gadgets
  732.     BYTE wd_BorderLeft
  733.     BYTE wd_BorderTop
  734.     BYTE wd_BorderRight
  735.     BYTE wd_BorderBottom
  736.     APTR wd_BorderRPort
  737.  
  738.     ; You supply a linked-list of gadget that you want for your Window.
  739.     ; This list DOES NOT include system Gadgets.  You get the standard
  740.     ; window system Gadgets by setting flag-bits in the variable Flags (see
  741.     ; the bit definitions below)
  742.     APTR wd_FirstGadget
  743.  
  744.     ; these are for opening/closing the windows 
  745.     APTR wd_Parent
  746.     APTR wd_Descendant
  747.  
  748.     ; sprite data information for your own Pointer
  749.     ; set these AFTER you Open the Window by calling SetPointer()
  750.     APTR wd_Pointer
  751.     BYTE wd_PtrHeight
  752.     BYTE wd_PtrWidth
  753.     BYTE wd_XOffset
  754.     BYTE wd_YOffset
  755.  
  756.     ; the IDCMP Flags and User's and Intuition's Message Ports 
  757.     ULONG wd_IDCMPFlags
  758.     APTR wd_UserPort
  759.     APTR wd_WindowPort
  760.     APTR wd_MessageKey
  761.  
  762.     BYTE wd_DetailPen
  763.     BYTE wd_BlockPen
  764.  
  765.     ; the CheckMark is a pointer to the imagery that will be used when 
  766.     ; rendering MenuItems of this Window that want to be checkmarked
  767.     ; if this is equal to NULL, you'll get the default imagery
  768.     APTR wd_CheckMark
  769.  
  770.     ; if non-null, Screen title when Window is active 
  771.     APTR wd_ScreenTitle
  772.  
  773.     ; These variables have the mouse coordinates relative to the 
  774.     ; inner-Window of GIMMEZEROZERO Windows.  This is compared with the
  775.     ; MouseX and MouseY variables, which contain the mouse coordinates
  776.     ; relative to the upper-left corner of the Window, GIMMEZEROZERO
  777.     ; notwithstanding
  778.     WORD wd_GZZMouseX
  779.     WORD wd_GZZMouseY
  780.     ; these variables contain the width and height of the inner-Window of
  781.     ; GIMMEZEROZERO Windows
  782.     WORD wd_GZZWidth
  783.     WORD wd_GZZHeight
  784.  
  785.     APTR wd_ExtData
  786.  
  787.     ; general-purpose pointer to User data extension 
  788.     APTR wd_UserData
  789.     APTR wd_WLayer      ; stash of Window.RPort->Layer
  790.  
  791.     ; NEW 1.2: need to keep track of the font that OpenWindow opened,
  792.     ; in case user SetFont's into RastPort
  793.     APTR IFont
  794.  
  795.     LABEL wd_Size
  796.  
  797. ; --- FLAGS REQUESTED (NOT DIRECTLY SET THOUGH) BY THE APPLIPROG -------------
  798. WINDOWSIZING    EQU $0001       ; include sizing system-gadget? 
  799. WINDOWDRAG      EQU $0002       ; include dragging system-gadget? 
  800. WINDOWDEPTH     EQU $0004       ; include depth arrangement gadget? 
  801. WINDOWCLOSE     EQU $0008       ; include close-box system-gadget? 
  802.  
  803. SIZEBRIGHT      EQU $0010       ; size gadget uses right border 
  804. SIZEBBOTTOM     EQU $0020       ; size gadget uses bottom border 
  805.  
  806. ; --- refresh modes ----------------------------------------------------------
  807. ; combinations of the REFRESHBITS select the refresh type 
  808. REFRESHBITS     EQU $00C0
  809. SMART_REFRESH   EQU $0000
  810. SIMPLE_REFRESH  EQU $0040
  811. SUPER_BITMAP    EQU $0080
  812. OTHER_REFRESH   EQU $00C0
  813.  
  814. BACKDROP        EQU $0100       ; this is an ever-popular BACKDROP window 
  815.  
  816. REPORTMOUSE     EQU $0200       ; set this to hear about every mouse move 
  817.  
  818. GIMMEZEROZERO   EQU $0400       ; make extra border stuff 
  819.  
  820. BORDERLESS      EQU $0800       ; set this to get a Window sans border 
  821.  
  822. ACTIVATE        EQU $1000       ; when Window opens, it's the Active one 
  823.  
  824. ; FLAGS SET BY INTUITION 
  825. WINDOWACTIVE    EQU $2000       ; this window is the active one 
  826. INREQUEST       EQU $4000       ; this window is in request mode 
  827. MENUSTATE       EQU $8000       ; this Window is active with its Menus on 
  828.  
  829. ; --- Other User Flags -------------------------------------------------------
  830. RMBTRAP         EQU $00010000   ; Catch RMB events for your own 
  831. NOCAREREFRESH   EQU $00020000   ; not to be bothered with REFRESH
  832.  
  833. ; --- Other Intuition Flags ----------------------------------------------
  834. WINDOWREFRESH   EQU $01000000   ; Window is currently refreshing
  835. WBENCHWINDOW    EQU $02000000   ; WorkBench Window
  836. WINDOWTICKED    EQU $04000000   ; only one timer tick at a time
  837.  
  838. SUPER_UNUSED    EQU $FCFC0000   ;bits of Flag unused yet
  839.  
  840.  
  841. ; --- see struct IntuiMessage for the IDCMP Flag definitions -----------------
  842.  
  843.  
  844. ; ======================================================================== 
  845. ; === NewWindow ========================================================== 
  846. ; ======================================================================== 
  847.  STRUCTURE NewWindow,0
  848.  
  849.     WORD nw_LeftEdge            ; initial Window dimensions
  850.     WORD nw_TopEdge             ; initial Window dimensions
  851.     WORD nw_Width               ; initial Window dimensions
  852.     WORD nw_Height              ; initial Window dimensions
  853.  
  854.     BYTE nw_DetailPen           ; for rendering the detail bits of the Window
  855.     BYTE nw_BlockPen            ; for rendering the block-fill bits 
  856.  
  857.     LONG nw_IDCMPFlags          ; initial IDCMP state
  858.  
  859.     LONG nw_Flags               ; see the Flag definition under Window
  860.  
  861.     ; You supply a linked-list of Gadgets for your Window.
  862.     ; This list DOES NOT include system Gadgets.  You get the standard
  863.     ; system Window Gadgets by setting flag-bits in the variable Flags (see
  864.     ; the bit definitions under the Window structure definition)
  865.     APTR        nw_FirstGadget
  866.  
  867.     ; the CheckMark is a pointer to the imagery that will be used when 
  868.     ; rendering MenuItems of this Window that want to be checkmarked
  869.     ; if this is equal to NULL, you'll get the default imagery
  870.     APTR nw_CheckMark
  871.  
  872.     APTR nw_Title               ; title text for the Window
  873.     
  874.     ; the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  875.     ; want this Window to open in it.  If so, you pass the address of the
  876.     ; Custom Screen structure in this variable.  Otherwise, this variable
  877.     ; is ignored and doesn't have to be initialized.
  878.     APTR nw_Screen
  879.     
  880.     ; SUPER_BITMAP Window?  If so, put the address of your BitMap structure
  881.     ; in this variable.  If not, this variable is ignored and doesn't have 
  882.     ; to be initialized
  883.     APTR nw_BitMap
  884.  
  885.     ; the values describe the minimum and maximum sizes of your Windows.
  886.     ; these matter only if you've chosen the WINDOWSIZING Gadget option,
  887.     ; which means that you want to let the User to change the size of 
  888.     ; this Window.  You describe the minimum and maximum sizes that the
  889.     ; Window can grow by setting these variables.  You can initialize
  890.     ; any one these to zero, which will mean that you want to duplicate
  891.     ; the setting for that dimension (if MinWidth == 0, MinWidth will be
  892.     ; set to the opening Width of the Window).
  893.     ; You can change these settings later using SetWindowLimits().
  894.     ; If you haven't asked for a SIZING Gadget, you don't have to
  895.     ; initialize any of these variables.
  896.     WORD nw_MinWidth
  897.     WORD nw_MinHeight
  898.     WORD nw_MaxWidth
  899.     WORD nw_MaxHeight
  900.  
  901.     ; the type variable describes the Screen in which you want this Window to
  902.     ; open.  The type value can either be CUSTOMSCREEN or one of the
  903.     ; system standard Screen Types such as WBENCHSCREEN.  See the
  904.     ; type definitions under the Screen structure
  905.     WORD nw_Type
  906.  
  907.     LABEL nw_SIZE
  908.  
  909. ; ======================================================================== 
  910. ; === Screen ============================================================= 
  911. ; ======================================================================== 
  912.  STRUCTURE Screen,0
  913.  
  914.     APTR sc_NextScreen          ; linked list of screens
  915.     APTR sc_FirstWindow         ; linked list Screen's Windows
  916.  
  917.     WORD sc_LeftEdge            ; parameters of the screen
  918.     WORD sc_TopEdge             ; parameters of the screen
  919.  
  920.     WORD sc_Width               ; null-terminated Title text
  921.     WORD sc_Height              ; for Windows without ScreenTitle
  922.  
  923.     WORD sc_MouseY              ; position relative to upper-left
  924.     WORD sc_MouseX              ; position relative to upper-left
  925.  
  926.     WORD sc_Flags               ; see definitions below
  927.  
  928.     APTR sc_Title
  929.     APTR sc_DefaultTitle
  930.  
  931.     ; Bar sizes for this Screen and all Window's in this Screen
  932.     BYTE sc_BarHeight
  933.     BYTE sc_BarVBorder
  934.     BYTE sc_BarHBorder
  935.     BYTE sc_MenuVBorder
  936.     BYTE sc_MenuHBorder
  937.     BYTE sc_WBorTop
  938.     BYTE sc_WBorLeft
  939.     BYTE sc_WBorRight
  940.     BYTE sc_WBorBottom
  941.  
  942.     BYTE sc_KludgeFill00        ; This is strictly for word-alignment 
  943.  
  944.     ; the display data structures for this Screen
  945.     APTR sc_Font                        ; this screen's default font
  946.     STRUCT sc_ViewPort,vp_SIZEOF        ; describing the Screen's display
  947.     STRUCT sc_RastPort,rp_SIZEOF        ; describing Screen rendering
  948.     STRUCT sc_BitMap,bm_SIZEOF          ; auxiliary graphexcess baggage
  949.     STRUCT sc_LayerInfo,li_SIZEOF       ; each screen gets a LayerInfo
  950.  
  951.     ; You supply a linked-list of Gadgets for your Screen.
  952.     ; This list DOES NOT include system Gadgets.  You get the standard
  953.     ; system Screen Gadgets by default
  954.     APTR sc_FirstGadget
  955.  
  956.     BYTE sc_DetailPen           ; for bar/border/gadget rendering
  957.     BYTE sc_BlockPen            ; for bar/border/gadget rendering
  958.  
  959.     ; the following variable(s) are maintained by Intuition to support the
  960.     ; DisplayBeep() color flashing technique
  961.     WORD sc_SaveColor0
  962.  
  963.     ; This layer is for the Screen and Menu bars
  964.     APTR sc_BarLayer            ; was "BarLayer"
  965.  
  966.     APTR sc_ExtData
  967.  
  968.     APTR sc_UserData            ; general-purpose pointer to User data 
  969.  
  970.     LABEL sc_SIZEOF
  971.  
  972.  
  973. ; --- FLAGS SET BY INTUITION -------------------------------------------------
  974. ; The SCREENTYPE bits are reserved for describing various Screen types
  975. ; available under Intuition.  
  976. SCREENTYPE      EQU     $000F   ; all the screens types available 
  977. ; --- the definitions for the Screen Type ------------------------------------
  978. WBENCHSCREEN    EQU     $0001   ; Ta Da!  The Workbench
  979. CUSTOMSCREEN    EQU     $000F   ; for that special look
  980.  
  981. SHOWTITLE       EQU     $0010   ; this gets set by a call to ShowTitle() 
  982.  
  983. BEEPING         EQU     $0020   ; set when Screen is beeping 
  984.  
  985. CUSTOMBITMAP    EQU     $0040   ; if you are supplying your own BitMap
  986.  
  987. SCREENBEHIND    EQU     $0080   ; if you want your screen to open behind
  988.                                 ; already open screens
  989.  
  990. SCREENQUIET     EQU     $0100   ; if you do not want Intuition to render
  991.                                 ; into your screen (gadgets, title)
  992.  
  993. STDSCREENHEIGHT EQU     -1      ; supply in NewScreen.Height
  994.  
  995. ; ======================================================================== 
  996. ; === NewScreen ========================================================== 
  997. ; ======================================================================== 
  998.  STRUCTURE NewScreen,0
  999.  
  1000.     WORD ns_LeftEdge            ; initial Screen dimensions
  1001.     WORD ns_TopEdge             ; initial Screen dimensions
  1002.     WORD ns_Width               ; initial Screen dimensions
  1003.     WORD ns_Height              ; initial Screen dimensions
  1004.     WORD ns_Depth               ; initial Screen dimensions
  1005.  
  1006.     BYTE ns_DetailPen           ; default rendering pens (for Windows too)
  1007.     BYTE ns_BlockPen            ; default rendering pens (for Windows too)
  1008.  
  1009.     WORD ns_ViewModes           ; display "modes" for this Screen
  1010.  
  1011.     WORD ns_Type                ; Intuition Screen Type specifier
  1012.  
  1013.     APTR ns_Font                ; default font for Screen and Windows
  1014.  
  1015.     APTR ns_DefaultTitle        ; Title when Window doesn't care
  1016.  
  1017.     APTR ns_Gadgets             ; Your own initial Screen Gadgets
  1018.  
  1019.     ; if you are opening a CUSTOMSCREEN and already have a BitMap 
  1020.     ; that you want used for your Screen, you set the flags CUSTOMBITMAP in
  1021.     ; the Types variable and you set this variable to point to your BitMap
  1022.     ; structure.  The structure will be copied into your Screen structure,
  1023.     ; after which you may discard your own BitMap if you want
  1024.     APTR ns_CustomBitMap
  1025.  
  1026.  LABEL    ns_SIZEOF
  1027.  
  1028.  
  1029. ; ======================================================================== 
  1030. ; === Preferences ======================================================== 
  1031. ; ======================================================================== 
  1032.  
  1033. ; these are the definitions for the printer configurations 
  1034. FILENAME_SIZE EQU       30      ; Filename size 
  1035.  
  1036. POINTERSIZE     EQU     (1+16+1)*2      ; Size of Pointer data buffer 
  1037.  
  1038. ; These defines are for the default font size.  These actually describe the
  1039. ; height of the defaults fonts.  The default font type is the topaz
  1040. ; font, which is a fixed width font that can be used in either 
  1041. ; eighty-column or sixty-column mode.  The Preferences structure reflects
  1042. ; which is currently selected by the value found in the variable FontSize,
  1043. ; which may have either of the values defined below.  These values actually
  1044. ; are used to select the height of the default font.  By changing the
  1045. ; height, the resolution of the font changes as well.
  1046. TOPAZ_EIGHTY    EQU     8       
  1047. TOPAZ_SIXTY     EQU     9
  1048.  
  1049. ; ------------------------------------------------------------------------
  1050.  STRUCTURE Preferences,0
  1051.  
  1052.     ; the default font height
  1053.     BYTE pf_FontHeight          ; height for system default font
  1054.  
  1055.     ; constant describing what's hooked up to the port
  1056.     BYTE pf_PrinterPort ; printer port connection
  1057.  
  1058.     ; the baud rate of the port
  1059.     WORD pf_BaudRate            ; baud rate for the serial port
  1060.     
  1061.     ; various timing rates
  1062.     STRUCT pf_KeyRptSpeed,TV_SIZE ; repeat speed for keyboard
  1063.     STRUCT pf_KeyRptDelay,TV_SIZE ; Delay before keys repeat
  1064.     STRUCT pf_DoubleClick,TV_SIZE ; Interval allowed between clicks
  1065.  
  1066.     ; Intuition Pointer data
  1067.     STRUCT pf_PointerMatrix,POINTERSIZE*2 ; Definition of pointer sprite
  1068.     BYTE pf_XOffset             ; X-Offset for active 'bit'
  1069.     BYTE pf_YOffset             ; Y-Offset for active 'bit'
  1070.     WORD pf_color17             ;********************************
  1071.     WORD pf_color18             ; Colours for sprite pointer
  1072.     WORD pf_color19             ;********************************
  1073.     WORD pf_PointerTicks        ; Sensitivity of the pointer    
  1074.  
  1075.     ; Workbench Screen colors
  1076.     WORD pf_color0              ;********************************
  1077.     WORD pf_color1              ;  Standard default colours
  1078.     WORD pf_color2              ;   Used in the Workbench
  1079.     WORD pf_color3              ;********************************
  1080.  
  1081.     ; positioning data for the Intuition View
  1082.     BYTE pf_ViewXOffset         ; Offset for top lefthand corner
  1083.     BYTE pf_ViewYOffset         ; X and Y dimensions
  1084.     WORD pf_ViewInitX           ; View initial offsets at startup
  1085.     WORD pf_ViewInitY           ; View initial offsets at startup
  1086.  
  1087.     BOOL EnableCLI              ; CLI availability switch
  1088.  
  1089.     ; printer configurations
  1090.     WORD pf_PrinterType         ; printer type
  1091.     STRUCT pf_PrinterFilename,FILENAME_SIZE ; file for printer
  1092.  
  1093.     ; print format and quality configurations
  1094.     WORD pf_PrintPitch          ; print pitch
  1095.     WORD pf_PrintQuality        ; print quality
  1096.     WORD pf_PrintSpacing        ; number of lines per inch
  1097.     WORD pf_PrintLeftMargin     ; left margin in characters
  1098.     WORD pf_PrintRightMargin    ; right margin in characters
  1099.     WORD pf_PrintImage          ; positive or negative
  1100.     WORD pf_PrintAspect         ; horizontal or vertical
  1101.     WORD pf_PrintShade          ; b&w, half-tone, or color
  1102.     WORD pf_PrintThreshold      ; darkness ctrl for b/w dumps
  1103.  
  1104.  
  1105.     ; print paper description
  1106.     WORD pf_PaperSize           ; paper size
  1107.     WORD pf_PaperLength         ; paper length in lines
  1108.     WORD pf_PaperType           ; continuous or single sheet
  1109.  
  1110.     ; Serial device settings: These are six nibble-fields in three bytes
  1111.     ; (these look a little strange so the defaults will map out to zero)
  1112.     BYTE pf_SerRWBits           ; upper nibble = (8-number of read bits)
  1113.                                  ; lower nibble = (8-number of write bits)
  1114.     BYTE pf_SerStopBuf          ; upper nibble = (number of stop bits - 1)
  1115.                                  ; lower nibble = (table value for BufSize)
  1116.     BYTE pf_SerParShk           ; upper nibble = (value for Parity setting)
  1117.                                  ; lower nibble = (value for Handshake mode)
  1118.  
  1119.     BYTE pf_LaceWB              ; if workbench is to be interlaced
  1120.  
  1121.     STRUCT pf_WorkName,FILENAME_SIZE ; temp file for printer
  1122.  
  1123.     BYTE pf_RowSizeChange       ; # to change gfxbase's NormalDisplayRows
  1124.     BYTE pf_ColumnSizeChange    ; # to change gfxbase's NormalDisplayColumns
  1125.  
  1126.     STRUCT pf_padding,14        ; For further system expansion
  1127.  
  1128.  
  1129.     LABEL pf_SIZEOF
  1130.  
  1131.  
  1132. ; === Preferences definitions ===========================================
  1133.  
  1134. ; Workbench Interlace (use one bit)
  1135. LACEWB          EQU     $01
  1136.  
  1137. ; PrinterPort
  1138. PARALLEL_PRINTER EQU    $00
  1139. SERIAL_PRINTER  EQU     $01
  1140.  
  1141. ; BaudRate
  1142. BAUD_110        EQU     $00
  1143. BAUD_300        EQU     $01
  1144. BAUD_1200       EQU     $02
  1145. BAUD_2400       EQU     $03
  1146. BAUD_4800       EQU     $04
  1147. BAUD_9600       EQU     $05
  1148. BAUD_19200      EQU     $06
  1149. BAUD_MIDI       EQU     $07
  1150.  
  1151. ; PaperType
  1152. FANFOLD         EQU     $00
  1153. SINGLE          EQU     $80
  1154.  
  1155. ; PrintPitch
  1156. PICA            EQU     $000
  1157. ELITE           EQU     $400
  1158. FINE            EQU     $800
  1159.  
  1160. ; PrintQuality
  1161. DRAFT           EQU     $000
  1162. LETTER          EQU     $100
  1163.  
  1164. ; PrintSpacing
  1165. SIX_LPI         EQU     $000
  1166. EIGHT_LPI       EQU     $200
  1167.  
  1168. ; Print Image
  1169. IMAGE_POSITIVE  EQU     $00
  1170. IMAGE_NEGATIVE  EQU     $01
  1171.  
  1172. ; PrintAspect
  1173. ASPECT_HORIZ    EQU     $00
  1174. ASPECT_VERT     EQU     $01
  1175.  
  1176. ; PrintShade
  1177. SHADE_BW        EQU     $00
  1178. SHADE_GREYSCALE EQU     $01
  1179. SHADE_COLOR     EQU     $02
  1180.  
  1181. ; PaperSize
  1182. US_LETTER       EQU     $00
  1183. US_LEGAL        EQU     $10
  1184. N_TRACTOR       EQU     $20
  1185. W_TRACTOR       EQU     $30
  1186. CUSTOM          EQU     $40
  1187.  
  1188. ; PrinterType
  1189. CUSTOM_NAME     EQU     $00
  1190. ALPHA_P_101     EQU     $01
  1191. BROTHER_15XL    EQU     $02
  1192. CBM_MPS1000     EQU     $03
  1193. DIAB_630        EQU     $04
  1194. DIAB_ADV_D25    EQU     $05
  1195. DIAB_C_150      EQU     $06
  1196. EPSON           EQU     $07
  1197. EPSON_JX_80     EQU     $08
  1198. OKIMATE_20      EQU     $09
  1199. QUME_LP_20      EQU     $0A
  1200. ; new printer entries, 3 October 1985
  1201. HP_LASERJET     EQU     $0B
  1202. HP_LASERJET_PLUS EQU    $0C
  1203.  
  1204.  
  1205. ; Serial Input Buffer Sizes
  1206. SBUF_512        EQU     $00
  1207. SBUF_1024       EQU     $01
  1208. SBUF_2048       EQU     $02
  1209. SBUF_4096       EQU     $03
  1210. SBUF_8000       EQU     $04
  1211. SBUF_16000      EQU     $05
  1212.  
  1213. ; Serial Bit Masks
  1214. SREAD_BITS      EQU     $F0     ; pf_SerRWBits
  1215. SWRITE_BITS     EQU     $0F
  1216.  
  1217. SSTOP_BITS      EQU     $F0     ; pf_SerStopBuf
  1218. SBUFSIZE_BITS   EQU     $0F
  1219.  
  1220. SPARITY_BITS    EQU     $F0     ; pf_SerParShk
  1221. SHSHAKE_BITS    EQU     $0F
  1222.  
  1223. ; Serial Parity (high nibble, but here shifted right, as by C-macro SPARNUM)
  1224. SPARITY_NONE    EQU     $00
  1225. SPARITY_EVEN    EQU     $01
  1226. SPARITY_ODD     EQU     $02
  1227.  
  1228. ; Serial Handshake Mode (low nibble, mask by SHSHAKE_BITS)
  1229. SHSHAKE_XON     EQU     $00
  1230. SHSHAKE_RTS     EQU     $01
  1231. SHSHAKE_NONE    EQU     $02
  1232.  
  1233. ; ========================================================================
  1234. ; === Remember ===========================================================
  1235. ; ========================================================================
  1236. ; this structure is used for remembering what memory has been allocated to
  1237. ; date by a given routine, so that a premature abort or systematic exit
  1238. ; can deallocate memory cleanly, easily, and completely
  1239.  STRUCTURE Remember,0
  1240.  
  1241.     APTR rm_NextRemember
  1242.     LONG rm_RememberSize
  1243.     APTR rm_Memory
  1244.  
  1245.  LABEL    rm_SIZEOF
  1246.  
  1247.  
  1248.  
  1249. ; ======================================================================== 
  1250. ; === Miscellaneous ====================================================== 
  1251. ; ======================================================================== 
  1252.  
  1253. ; = MACROS ============================================================== 
  1254. ;#define MENUNUM(n) (n & 0x1F)
  1255. ;#define ITEMNUM(n) ((n >> 5) & 0x003F)
  1256. ;#define SUBNUM(n) ((n >> 11) & 0x001F)
  1257. ;
  1258. ;#define SHIFTMENU(n) (n & 0x1F)
  1259. ;#define SHIFTITEM(n) ((n & 0x3F) << 5)
  1260. ;#define SHIFTSUB(n) ((n & 0x1F) << 11)
  1261. ;
  1262. ;#define SRBNUM(n)  (0x08 - (n >> 4))  /* SerRWBits -> read bits per char */
  1263. ;#define SWBNUM(n)  (0x08 - (n & 0x0F))/* SerRWBits -> write bits per chr */
  1264. ;#define SSBNUM(n)  (0x01 + (n >> 4))  /* SerStopBuf -> stop bits per chr */
  1265. ;#define SPARNUM(n) (n >> 4)           /* SerParShk -> parity setting    */
  1266. ;#define SHAKNUM(n) (n & 0x0F)         /* SerParShk -> handshake mode    */
  1267. ;
  1268. ; = MENU STUFF =========================================================== 
  1269. NOMENU EQU      $001F
  1270. NOITEM EQU      $003F
  1271. NOSUB  EQU      $001F
  1272. MENUNULL EQU    $FFFF
  1273.  
  1274.  
  1275. ; = =RJ='s peculiarities ================================================= 
  1276. ;#define FOREVER for(;;)
  1277. ;#define SIGN(x) ( ((x) > 0) - ((x) < 0) )
  1278.  
  1279.  
  1280. ; these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1281. ; I'll use a generic Width (for all resolutions) for the CheckMark.
  1282. ; If COMMSEQ, likewise I'll use this generic stuff
  1283. CHECKWIDTH      EQU     19
  1284. COMMWIDTH       EQU     27
  1285. LOWCHECKWIDTH   EQU     13
  1286. LOWCOMMWIDTH    EQU     16
  1287.  
  1288.  
  1289. ; these are the AlertNumber defines.  if you are calling DisplayAlert()
  1290. ; the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1291. ; of these patterns
  1292. ALERT_TYPE      EQU     $80000000
  1293. RECOVERY_ALERT  EQU     $00000000       ; the system can recover from this 
  1294. DEADEND_ALERT   EQU     $80000000       ; no recovery possible, this is it 
  1295.  
  1296.  
  1297. ; When you're defining IntuiText for the Positive and Negative Gadgets 
  1298. ; created by a call to AutoRequest(), these defines will get you 
  1299. ; reasonable-looking text.  The only field without a define is the IText
  1300. ; field; you decide what text goes with the Gadget
  1301. AUTOFRONTPEN    EQU     0
  1302. AUTOBACKPEN     EQU     1
  1303. AUTODRAWMODE    EQU     RP_JAM2
  1304. AUTOLEFTEDGE    EQU     6
  1305. AUTOTOPEDGE     EQU     3
  1306. AUTOITEXTFONT   EQU     0
  1307. AUTONEXTTEXT    EQU     0
  1308.  
  1309.  
  1310.  
  1311. ;* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) -------------------
  1312. SELECTUP        EQU     (IECODE_LBUTTON+IECODE_UP_PREFIX)
  1313. SELECTDOWN      EQU     (IECODE_LBUTTON)
  1314. MENUUP          EQU     (IECODE_RBUTTON+IECODE_UP_PREFIX)
  1315. MENUDOWN        EQU     (IECODE_RBUTTON)
  1316. ALTLEFT         EQU     (IEQUALIFIER_LALT)
  1317. ALTRIGHT        EQU     (IEQUALIFIER_RALT)
  1318. AMIGALEFT       EQU     (IEQUALIFIER_LCOMMAND)
  1319. AMIGARIGHT      EQU     (IEQUALIFIER_RCOMMAND)
  1320. AMIGAKEYS       EQU     (AMIGALEFT+AMIGARIGHT)
  1321.                         
  1322. CURSORUP        EQU     $4C
  1323. CURSORLEFT      EQU     $4F
  1324. CURSORRIGHT     EQU     $4E
  1325. CURSORDOWN      EQU     $4D
  1326. KEYCODE_Q       EQU     $10
  1327. KEYCODE_X       EQU     $32
  1328. KEYCODE_N       EQU     $36
  1329. KEYCODE_M       EQU     $37
  1330. KEYCODE_V       EQU     $34
  1331. KEYCODE_B       EQU     $35
  1332.  
  1333.         IFND    INTUITION_INTUITIONBASE_I
  1334.         include 'intuition/intuitionbase.i'
  1335.         ENDC
  1336.  
  1337.         ENDC
  1338.  
  1339.  
  1340.  
  1341.